<%@ page language="java" pageEncoding="UTF-8" isELIgnored="true"%>
<%@ taglib uri="/struts-tags" prefix="s"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>选择模板</title>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/css.css"/>
<script src="<%=request.getContextPath()%>/js/jquery-1.4.2.min.js" type="text/javascript"></script>
</head>
<style type="text/css">
<!--
.STYLE3 {color: #003399}
a:link {
	color: #FF3300;
}
a:visited {
	color: #330099;
}
a:hover {
	color: #003366;
}
body {
	margin-left: 0px;
	margin-top: 20px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<body>
<s:form action="addDoc" theme="simple">
<s:hidden name="docType" id="docType"></s:hidden>
<s:hidden name="modDocId" id="modDocId"></s:hidden>
<s:hidden name="userId" id="userId"></s:hidden>
<s:hidden name="jlid" id="jlid"/>
<s:hidden name="ksId" id="ksId"/>
<s:iterator value="oids" status="i">
 <input type="hidden" name="oids" value="<s:property value="oids[#i.index]"/>"/>
</s:iterator>
<table   width="95%"  border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#C3CFDD"  class="inputform" >
<colgroup>
 <col width="10%"/>
 <col width="25%"/>
 <col width="15%"/>
 <col />
</colgroup>
  <tr bgcolor="#F0F4F9">
    <td colspan="4"  ><p align="left">当前步骤选择模板</p></td>
  </tr>
  <tr>
	  <th>word文档模板：</th>
	  <td>
	   <s:select id="modWordId" name="modWordId" list="wordTemplateList" listKey="templateId" listValue="descript" cssStyle="width:75%;" headerKey="" headerValue="请选择"/>
	   <span style="color: #FF0000; font-weight:bold"> *</span>
	  </td>
	 <td><input name="" value="起草Word证书"  type="button" onclick="doSubmit('doc');"/></td>
	 <td>
	   提示: 系统会自动下载安装控件,如果没有安装成功,请联系我们！
	 </td>
  </tr>
  
  <!--  tr>
	  <th>Excel文档模板：</th>
	  <td>
	   <s:select id="modExcelId" name="modExcelId" list="excelTemplateList" listKey="templateId" listValue="descript" cssStyle="width:75%;" headerKey="" headerValue="请选择"/>
	   <span style="color: #FF0000; font-weight:bold"> *</span>
	   </td>
	   <td><input name="" value="起草Excel证书"  type="button" onclick="doSubmit('xls');"/>
	 </td>
  </tr -->
  <s:if test="#request.yqbhs !=null">
  <tr>
   <td colspan="4">
   <span style="color: #FF0000; font-weight:bold">所选仪器编号是：</span><b><s:property value="#request.yqbhs"/></b>
   </td>
  </tr>
  </s:if>
</table>

</s:form>
<script language=javascript>
 function doSubmit(modDocId){
	 if(modDocId =='doc' ){
		 if($('#modWordId').val() ==''){
			 alert("Word模板不能为空!");
			 $('#modWordId').focus();
			 return false;
		 }else{
			 $('#docType').val(modDocId);
			 $('#modDocId').val($('#modWordId').val());
			 document.forms[0].submit();
		 }
	 }else {
		 if($('#modExcelId').val() ==''){
			 alert("Excel模板不能为空!");
			 $('#modExcelId').focus();
			 return false;
		 }else{
			 $('#docType').val(modDocId);
			 $('#modDocId').val($('#modExcelId').val());
			 document.forms[0].submit();
		 }
	 }
	 
 }
</script>
</body>
</html>
